package com.hqyj.product.service.impl;

import com.hqyj.product.mapper.MaterialsInfoMapper;
import com.hqyj.product.model.MaterialsInfo;
import com.hqyj.product.service.MaterialsInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class MaterialsInfoServiceImpl implements MaterialsInfoService {

    @Autowired
    private MaterialsInfoMapper materialsInfoMapper;

    @Override
    public List<MaterialsInfo> queryAllMaterialsInfo() {
        return materialsInfoMapper.queryAllMaterialsInfo();
    }

    @Override
    public int addMaterialsInfoByMaterialsInfo(MaterialsInfo materialsInfo) {
        return materialsInfoMapper.insertSelective(materialsInfo);
    }

    @Override
    public int deleteMaterialsInfoById(int materialsInfoId) {
        return materialsInfoMapper.deleteByPrimaryKey(materialsInfoId);
    }

    @Override
    public MaterialsInfo queryMaterialsInfoById(int materialsInfoId) {
        return materialsInfoMapper.selectByPrimaryKey(materialsInfoId);
    }

    @Override
    public int updateMaterialsInfoByMaterialsInfo(MaterialsInfo materialsInfo) {
        return materialsInfoMapper.updateByPrimaryKeySelective(materialsInfo);
    }
}
